package com.huluobo.a2205monthdemo.sign

import androidx.lifecycle.MutableLiveData
import com.huluobo.base.mvvm.BaseViewModel
import com.huluobo.base.net.ApiService
import dagger.hilt.android.lifecycle.HiltViewModel
import okhttp3.RequestBody
import javax.inject.Inject

/**
 *  Created by LC on 2024/10/7.
 */
@HiltViewModel
class SIgnViewModel @Inject constructor(
    val apiService: ApiService
) : BaseViewModel() {
    val signStartSuccess by lazy { MutableLiveData<String>() }
    fun signStart(body: RequestBody) {
        executeNetRequest(
            { apiService.signStart(body) },
            signStartSuccess::postValue
        )
    }

    val signEndSuccess by lazy { MutableLiveData<String>() }
    fun signEnd(body: RequestBody) {
        executeNetRequest(
            { apiService.signEnd(body) },
            signEndSuccess::postValue
        )
    }

    val signMonthSuccess by lazy { MutableLiveData<String>() }
    fun signMonth(body: RequestBody) {
        executeNetRequest(
            { apiService.getMonthSign(body) },
            signMonthSuccess::postValue
        )
    }
}